Skip Headers

Oracle® Objects for OLE C++ Class Library Developer's Guide 10g Release 2 (10.2) Part Number B14308-01 |
Home | Book List | Contents | Index | Master Index | Feedback

# MoveFirst Method

Applies To

OBinder

ODynaset

Description

This method changes the current record to be the first record in the dynaset's result set.

Usage

oresult MoveFirst(void)

Remarks

This method sets the current record of the dynaset (for OBinder, the dynaset being managed by the OBinder object) to be the first record in the result set.

Execution of this method sends OADVISE_MOVE_FIRST messages to all attached advisories. One of the advisories could cancel the move, which would result in an OFAILURE return.

If the dynaset is being managed by an OBinder object, this method causes PreMove and PostMove triggers to be called.

By default, when a dynaset is created by opening an ODynaset, a MoveFirst is performed automatically.

Return Value

An oresult indicating whether the operation succeeded (OSUCCESS) or not (OFAILURE).

Example

Move to the first record in a dynaset:

// we assume that we have an open dynaset named empdyn

// Move to the first record

oresult ores = empdyn.MoveFirst();

// if ores == OSUCCESS we got there